package com.jr.service.impl;


import com.jr.entity.UserJobEnterprise;
import com.jr.mapper.UserJobEnterpriseDao;
import com.jr.service.UserJobEnterpriseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


/**
 * 用户工作企业三表关联
 *
 * @author Snoopy
 * @since 1.0.0 2022-12-31
 */
@Service
public class UserJobEnterpriseServiceImpl implements UserJobEnterpriseService {
    /**
     * @description: 描述
     * @author: 张杨
     * @date: 2023/1/12 11:01
     * @param:
     * @return:
     **/
    @Autowired
    private UserJobEnterpriseDao userJobEnterpriseDao;
    /**
     * @description: 查询所有所有企业和所有工作信息
     * @author: 张杨
     * @date: 2023/1/12 11:03
     * @param: [map]
     * @return: java.util.List<com.jr.entity.UserJobEnterprise>
     **/
    @Override
    public List<UserJobEnterprise> getAllJob(Map<String, String> map) {
        return userJobEnterpriseDao.selectJobs(map);
    }
    /**
     * @description: 根据用户Id查询所有企业和所有工作信息
     * @author: 张杨
     * @date: 2023/1/12 11:04
     * @param: [map]
     * @return: java.util.List<com.jr.entity.UserJobEnterprise>
     **/
    @Override
    public List<UserJobEnterprise> getAllJobbyuid(Map<String, String> map) {
        return userJobEnterpriseDao.selectJobsbyuid(map);
    }
    /**
     * @description: 更改申请状态
     * @author: 张杨
     * @date: 2023/1/12 11:04
     * @param: [userJobEnterprise]
     * @return: boolean
     **/
    @Override
    public boolean updateApplication(UserJobEnterprise userJobEnterprise) {
        return userJobEnterpriseDao.updateUserJobEnterprise(userJobEnterprise)==1?true:false;
    }
    /**
     * @description: 添加三联表信息
     * @author: 张杨
     * @date: 2023/1/12 11:04
     * @param: [userJobEnterprise]
     * @return: boolean
     **/
    @Override
    public boolean addApplication(UserJobEnterprise userJobEnterprise) {
        return userJobEnterpriseDao.insertUserJobEnterprise(userJobEnterprise)==1;
    }
    /**
     * @description: 更改关注状态
     * @author: 张杨
     * @date: 2023/1/12 11:05
     * @param: [userJobEnterprise]
     * @return: boolean
     **/
    @Override
    public boolean modifyEnterpriseAttention(UserJobEnterprise userJobEnterprise) {
        return userJobEnterpriseDao.updateEnterpriseAttention(userJobEnterprise)==1?true:false;
    }
    /**
     * @description: 查询job全部条数
     * @author: 张杨
     * @date: 2023/1/12 11:05
     * @param: [map]
     * @return: int
     **/
    @Override
    public int getTotalRows(Map<String,String> map) {
        return userJobEnterpriseDao.queryTotalRows(map);
    }
    /**
     * @description: 查询UserJobEnterprise全部数据条数
     * @author: 张杨
     * @date: 2023/1/12 11:06
     * @param: [map]
     * @return: int
     **/
    @Override
    public int getTotal(Map<String,String> map) {
        return userJobEnterpriseDao.queryTotal(map);
    }
    /**
     * @description: 获取三链表里面符合条件的信息
     * @author: 张杨
     * @date: 2023/1/12 11:06
     * @param: [userJobEnterprise]
     * @return: com.jr.entity.UserJobEnterprise
     **/
    @Override
    public UserJobEnterprise getUserJobEnterprise(UserJobEnterprise userJobEnterprise) {
        return userJobEnterpriseDao.selectUserJobEnterprise(userJobEnterprise);
    }
    /**
     * @description: 根据 jid查询工作
     * @author: 张杨
     * @date: 2023/1/12 11:06
     * @param: [map]
     * @return: com.jr.entity.UserJobEnterprise
     **/
    @Override
    public UserJobEnterprise selectJobByJid(Map<String, String> map) {
        return userJobEnterpriseDao.selectJobByJid(map);
    }
}